package com.itheima.datasource;

import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.junit.Test;

import javax.sql.DataSource;
import java.sql.Connection;
import java.util.Properties;

public class Druid {
    @Test
    public void testGteCoonection() throws Exception{
        Properties properties = new Properties();
        properties.load(Druid.class.getClassLoader().getResourceAsStream("druid.properties"));

        DataSource dataSource = DruidDataSourceFactory.createDataSource(properties);
        Connection connection0 = dataSource.getConnection();
        Connection connection1 = dataSource.getConnection();
        //Connection connection2 = dataSource.getConnection();
        System.out.println(connection0);
        System.out.println(connection1);
        //System.out.println(connection2);
    }
}
